<?php
echo '<form action="edit.php" method="post">'."\n";

echo '<div class="contact_edit">'."\n";
echo '<div class="form_row">'."\n";
echo "\t".'<span class="form_label">First Name</span>'."\n";
echo "\t".'</span class="form_input"><input type="input" name="fname" value="'.$contact[ 'fname' ].'" maxlength="32" /></span>'."\n";
echo '</div>'."\n\n";

echo '<div class="form_row">'."\n";
echo "\t".'<span class="form_label">Last Name</span>'."\n";
echo "\t".'<span class="form_input"><input type="input" name="lname" value="'.$contact[ 'lname' ].'" maxlength="32" /></span>'."\n";
echo '</div>'."\n\n";

echo '<div class="form_row">'."\n";
echo "\t".'<span class="form_label">Email</span>'."\n";
echo "\t".'<span class="form_input"><input type="input" name="email" value="'.$contact[ 'email' ].'" maxlength="255" /></span>'."\n";
echo '</div>'."\n\n";
echo '</div>'."\n\n";

echo '<div class="actions_bottom">'."\n";
echo '<div class="form_row">'."\n";
switch ( $edit_type ) {
    case 'edit':
        echo "\t".'<span class="form_label">&nbsp;<input type="hidden" name="id" value="'.$id.'" /></span>'."\n";
        echo "\t".'<span class="form_input">'."\n";
        echo "\t\t".'<button type="submit" name="action" value="save">Save</button>'."\n";
        echo "\t\t".'<button type="submit" name="action" value="cancel">Cancel</button>'."\n";
        echo "\t\t".'<button type="submit" name="action" value="delete">Delete</button>'."\n";
        echo "\t".'</span>'."\n";
        break;
    case 'new':
        echo "\t".'<span class="form_label">&nbsp;</span>'."\n";
        echo "\t".'<span class="form_input">'."\n";
        echo "\t\t".'<button type="submit" name="action" value="create">Create</button>'."\n";
        echo "\t\t".'<button type="submit" name="action" value="cancel">Cancel</button>'."\n";
        echo "\t".'</span>'."\n";
        break;
}
echo '</div>'."\n\n";

echo '</form>'."\n";

?>
